unit SmallStruct.Database.TSSDatabaseDriver;

interface

uses Classes,
  Types,
  Variants,
  SmallStruct.Core.TSSRuntimeObject,
  SmallStruct.Core.TSSObjectContext,
  SmallStruct.Database;

type
  TSSDatabaseDriverContext = class(TSSObjectContext, ISSDatabaseDriverContext)
  end;

  TSSDatabaseDriver = class(TSSRuntimeObject, ISSDatabaseDriver)
  public
    function ExecuteProcedure(const ProcedureName: string; Parameters: Variant): Integer; virtual; abstract;
    function ExecuteSQL(const SQL: string): Integer; virtual; abstract;
    function UploadBlobField(const EntityName, KeyFieldName, BlobFieldName: string; Key: Integer; Buffer: TStream): Integer; virtual; abstract;
    function DownloadBlobField(const EntityName, KeyFieldName, BlobFieldName: string; Key: Integer; Buffer: TStream): Integer; virtual; abstract;
    function Query(const SQL: string): ISSDataSet; overload; virtual; abstract;
    //    function Query(const SQL: string): ISSDataSetModifiable; overload;virtual; abstract;
    function QueryByModified(const SQL: string): ISSDataSetModifiable; virtual; abstract; //ISSDataSetModifiable
    procedure CommitTransaction; virtual; abstract;
    procedure Conntect; virtual; abstract;
    procedure Deconnect; virtual; abstract;
    procedure GetTableNames(ATableNames: TStringList); virtual; abstract;
    procedure GetFieldNames(const ATableName: string; AFieldNames: TStringList); virtual; abstract;
    procedure RollbackTransaction; virtual; abstract;
    procedure StartTransaction; virtual; abstract;
    function AppendTable(const TableName, KeyFieldName: string): Boolean; virtual; abstract;
    function DeleteTable(const TableName: string): Boolean; virtual; abstract;
    function AppendField(const TableName, FieldName, DataType: string): Boolean; virtual; abstract;
    function DeleteField(const TableName, FieldName: string): Boolean; virtual; abstract;
    function FindTable(const TableName: string): Boolean; virtual; abstract;
    function FindField(const TableName, FieldName: string): Boolean; virtual; abstract;
  end;

  TSSDatabaseDriverClass = class of TSSDatabaseDriver;

implementation

end.
